package com.example.li.day9_27;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;

import com.example.li.day9_27.mvp.Presenter.IMainPresenter;
import com.example.li.day9_27.mvp.Presenter.MainPresenter;
import com.example.li.day9_27.mvp.View.IMainView;
import com.example.li.day9_27.pojo.User;


public class MainActivity extends AppCompatActivity implements IMainView {

    private static final String TAG = "MainActivity";
    private MainPresenter mainPresenter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mainPresenter = new MainPresenter(this);
    }

    @Override
    public void onBackPressed() {

        mainPresenter.login("kim","001");

    }

    @Override
    public void updateUserInfo(User user) {
        Log.d(TAG, "updateUserInfo: "+user.toString());
    }

    @Override
    public void showErrorInfo(String e) {
        Log.d(TAG, "showErrorInfo: "+e);
    }
}
